{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9e52d21e",
   "metadata": {},
   "source": [
    "----------------\n",
    "* 2022/9/5/week 03\n",
    "* Python学习记录\n",
    "* 记录人：wu-huichun"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c119df26",
   "metadata": {},
   "source": [
    "# 本周学习目标\n",
    "> 1.模块\n",
    "\n",
    "> 2.变量\n",
    "\n",
    "> 3.循环遍历"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6b7c7705",
   "metadata": {},
   "source": [
    "# 1.模块"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a93d08f9",
   "metadata": {},
   "source": [
    "## 1.1模块 [标准库](https://docs.python.org/3/library/index.html)\n",
    "\n",
    "> Python创始人团队为后面使用这门编程语言的人们提供的解决日常生活可能使用到的功能，而制作的可以方便使用的模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6ca895cf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1662345926.9549375"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 纪元(1970.1.1)\n",
    "# 时间戳\n",
    "import time\n",
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "73e6caa7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1662346043.4826868"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8f9aacc1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=5, tm_hour=10, tm_min=46, tm_sec=59, tm_wday=0, tm_yday=248, tm_isdst=0)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "81123e9a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=5, tm_hour=2, tm_min=47, tm_sec=54, tm_wday=0, tm_yday=248, tm_isdst=0)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.gmtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d93f6a6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Mon Sep  5 10:53:25 2022'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.asctime(time.localtime())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "55c48275",
   "metadata": {},
   "source": [
    "# 1.2模块（开源模块）\n",
    "\n",
    "> 1.因为代码开源\n",
    "\n",
    "> 2.集合全领域（全人类）的需求\n",
    "\n",
    "> 3.按照国际标准开放的模块库\n",
    "\n",
    "> [资源地址]（）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3bf78d9f",
   "metadata": {},
   "source": [
    "## 1.3模块（自定义模块）\n",
    "\n",
    "> 1.不愿意开源的有一定知识产权的（开放API租用形式开放）\n",
    "\n",
    "> 2.自己用的，写的也不怎么好，开源出去丢人的"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "73c79f29",
   "metadata": {},
   "source": [
    "# 2.变量\n",
    "\n",
    "> 1.声明变量（命名）\n",
    "\n",
    ">> 1.变量名只能是 字母、数字或下划线的任意组合\n",
    "\n",
    ">> 2.变量名的第一个字符不能是数字\n",
    "\n",
    ">> 3.以下关键字不能声明为变量名\n",
    "['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda','not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']   在jupyter环境中显示绿色的不能命名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "5c2e2ee6",
   "metadata": {},
   "outputs": [],
   "source": [
    "网一_01_name = \"Huichun Wu\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "f09f9dd5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Huichun Wu'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网一_01 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3a0a0098",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2124615047536"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "id(网一_01 )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "0d11008b",
   "metadata": {},
   "outputs": [],
   "source": [
    "网一_01_age = 19"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "e757bdd0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网一_01_age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "08219121",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "21101300023 21101300023\n"
     ]
    }
   ],
   "source": [
    "# 案例（关于变量）\n",
    "网一_01_ID = \"21101300023\"\n",
    "\n",
    "网一_02_ID = 网一_01_ID\n",
    "\n",
    "print(网一_01_ID,网一_02_ID)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "2cd7ce3a",
   "metadata": {},
   "outputs": [],
   "source": [
    "网一_01_ID = \"21101300024\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "a73484ee",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "21101300024 21101300023\n"
     ]
    }
   ],
   "source": [
    "print(网一_01_ID,网一_02_ID)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8fb2c389",
   "metadata": {},
   "source": [
    "# 课后作业\n",
    "* 课本P4项目练习（一遍运行成功）\n",
    "* 思考if是什么\n",
    "* 思考from是什么"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22aceb63",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1770d815",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
